package grpc

import (
	"fmt"
	"gin/global"
	course "gin/internal/pb/course"
	"google.golang.org/grpc"
)

func CourseClient() {
	// 1.连接
	conn, err := grpc.Dial("127.0.0.1:8081", grpc.WithInsecure())
	if err != nil {
		fmt.Printf("连接异常： %s\n", err)
		return
	}
	// 2. 实例化gRPC客户端
	global.CourseClient = course.NewCourseClient(conn)

}
